/*
 * @Author: anxia.ack anchenkai@come-future.com
 * @Date: 2025-04-16 11:49:02
 * @LastEditors: anxia.ack anchenkai@come-future.com
 * @LastEditTime: 2025-04-20 20:37:23
 * @FilePath: /free-learning/src/api/course/course-audit/index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from "@/utils/request";
import type { CourseListParams } from "../course-mange/type";
import type { CourseAudit, CourseAuditPageVO, CourseInfoVO } from "./type";

const COURSE_AUDIT_BASE_URL = "/api/v1/course/audit";

export const getCourseAudiPageList = (params: CourseListParams) => {
  return request<any, MyPageResult<CourseAuditPageVO>>({
    url: `${COURSE_AUDIT_BASE_URL}/page`,
    method: "post",
    data: params,
  });
};
export const auditCourse = (params: CourseAudit) => {
  return request<boolean>({
    url: `${COURSE_AUDIT_BASE_URL}/audit`,
    method: "post",
    data: params,
  });
};

export const getCourseAuditInfo = (id: number) => {
  return request<CourseInfoVO>({
    url: `${COURSE_AUDIT_BASE_URL}/info/${id}`,
    method: "get",
  });
};

export const getCourseAuditHistory = (id: number): Promise<CourseAudit[]> => {
  return request({
    url: `${COURSE_AUDIT_BASE_URL}/history/${id}`,
    method: "get",
  });
};
